package org.point.service.impl;

import java.io.Serializable;
import java.util.List;

import org.point.common.service.impl.BaseServiceImpl;
import org.point.common.util.DoPage;
import org.point.dao.impl.CreditsRecordDaoImpl;
import org.point.domain.CreditsRecord;
import org.point.service.CreditsRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 
 * @ClassName: CreditsRecordServiceImpl  
 * @Description: TODO(积分记录业务实现类)  
 * @author Kenny_Z' szqiuk@gmail.com
 * @date 2016年10月23日 下午4:02:01  
 *
 */
@Service("creditsRecordService")
public class CreditsRecordServiceImpl extends BaseServiceImpl<CreditsRecord, Serializable> implements CreditsRecordService {
	
	@Autowired
	private CreditsRecordDaoImpl dao;

	public List<CreditsRecord> searchCreditsRecord(DoPage<CreditsRecord> page) {
		List<CreditsRecord> records = dao.findCRecForMem(page);
		return records;
	}
	
	public DoPage<CreditsRecord> searchCRForPage(DoPage<CreditsRecord> page) {
		List<CreditsRecord> records = dao.findCRecForMem(page);
		Integer totalRecords = dao.countCRecForMem(page);
		page.setList(records);
		page.setTotalRecords(totalRecords);
		return page;
	}
	
	public Integer countCreditsRecord(DoPage<CreditsRecord> page) {
		Integer result = dao.countCRecForMem(page);
		return result;
	}
	
	public Integer insertCreditsRecord(CreditsRecord record) {
		Integer result = dao.inertCRec(record);
		return result;
	}



}
